#!ipxe

# OpenBSD Operating System
# http://www.openbsd.org

:openbsd_menu
set os {{ releases.openbsd.name }}
menu ${os}
{% for item in releases.openbsd.versions %}
item {{ item.code_name }} ${space} ${os} {{ item.name }}
{% endfor %}
choose ver || goto openbsd_exit
{% for item in releases.openbsd.versions %}
iseq ${ver} {{ item.code_name }} && set image_ver {{ item.image_ver }} ||
{% endfor %}
iseq ${arch} x86_64 && goto openbsd_x64 ||
set openbsd_arch i386
goto boot_openbsd

:openbsd_x64
set openbsd_arch amd64
goto boot_openbsd

:boot_openbsd
set src ${openbsd_mirror}/${openbsd_base_dir}/${ver}/${openbsd_arch}/cd${image_ver}.iso
imgfree
initrd ${src}
chain ${memdisk} iso raw
exit

:openbsd_exit
clear menu
exit 0